using System.Collections;
using UnityEngine;

public class BulletController : MonoBehaviour
{
    private float speed = 12.0f;
    private float lifetime = 3.0f;
    
    void Start()
    {
        StartCoroutine(DestroyBullet());
    }
    
    void Update()
    {
        transform.Translate(Vector3.forward * (speed * Time.deltaTime),Space.Self);
    }
    
    IEnumerator DestroyBullet()
    {
        yield return new WaitForSeconds(lifetime);
        Destroy(gameObject);
    }
}
